package com.demo;

import cn.qu.v1.platform.inject.annotation.*;
import cn.qu.v1.platform.plugin.annotation.ServiceStart;

/**
 * Created by zh on 17/1/7.
 */
@Configuration
@Import(Conf.class)
public class HelloWorld {

    @Inject
    private A a;

    @Inject
    private B b;

    @Inject
    private HelloBean helloBean;

    @Bean
    public A createA(@Qualifier("b") B b) {
//        A a = new A("createA");
        A a = new A(b);
        return a;
    }

    @Bean
    public HelloBean createHelloBean() {
        return new HelloBean();
    }


    @ServiceStart
    public void run() {
        System.out.println(666);
        if (a == null) {
            System.out.println("a is null");
        } else {
            System.out.println("a.a is " + a.getA());
        }

        b.testaop("aaa", 666);
//        System.out.println(b);
        if (helloBean != null) {
            System.out.println(helloBean.say("hhh"));
        }
    }

}
